cmake_minimum_required(VERSION 3.5)
project(sinx_tester_cpp)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 找到 LibTorch 包
# 将 /path/to/libtorch 替换为你的 LibTorch 解压路径
set(DCMAKE_PREFIX_PATH "/Users/aohuili/lib/libtorch")
find_package(Torch REQUIRED)

# 添加可执行文件
add_executable(sinx_tester main.cpp)

# 链接 Torch 库
target_link_libraries(sinx_tester "${TORCH_LIBRARIES}")

# 设置 C++11 ABI 以避免链接错误
set_property(TARGET sinx_tester PROPERTY CXX_STANDARD_COMPATIBILITY "ON")